﻿<%@ Page Language="C#" MasterPageFile="~/administrator/Admin.Master" AutoEventWireup="true" CodeBehind="ThamSoGia.aspx.cs" Inherits="KTSonline.administrator.ThamSoGia" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div class="title">Quản lý Tham số giá tìm kiếm
    <asp:Button ID="btnAdd" runat="server" Text="Add record" CssClass="btnAdd" 
            onclick="btnAdd_Click"/></div>
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
        DataKeyNames="id" DataSourceID="LinqDataSource1" AllowPaging="True" 
        CssClass="datagrid" PageSize="15" 
    OnRowDeleting="GridView1_RowDeleting" onrowediting="GridView1_RowEditing">
        <Columns>
            <asp:BoundField DataField="id" HeaderText="id" ReadOnly="True" Visible="false"
                SortExpression="id" InsertVisible="False" />
            <asp:BoundField DataField="mode" HeaderText="mode" 
                SortExpression="mode" />
            <asp:TemplateField HeaderText="giatu" SortExpression="giatu">
                <ItemTemplate>
                    <asp:Label ID="Label1" runat="server" Text='<%# Bind("giatu", "{0:N0}") %>'></asp:Label>
                </ItemTemplate>
                <EditItemTemplate>
                    <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("giatu") %>'></asp:TextBox>
                </EditItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="giaden" SortExpression="giaden">
                <ItemTemplate>
                    <asp:Label ID="Label2" runat="server" Text='<%# Bind("giaden", "{0:N0}") %>'></asp:Label>
                </ItemTemplate>
                <EditItemTemplate>
                    <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("giaden") %>'></asp:TextBox>
                </EditItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField ShowHeader="False">
                <ItemTemplate>
                    <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" 
                        CommandName="Edit" Text="Edit"></asp:LinkButton>
                    &nbsp;<asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" OnClientClick="return confirm('Delete this record?');"
                        CommandName="Delete" Text="Delete"></asp:LinkButton>
                </ItemTemplate>
                <EditItemTemplate>
                    <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="True" 
                        CommandName="Update" Text="Update"></asp:LinkButton>
                    &nbsp;<asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" 
                        CommandName="Cancel" Text="Cancel"></asp:LinkButton>
                </EditItemTemplate>
            </asp:TemplateField>
        </Columns>
    </asp:GridView>
    <asp:DetailsView ID="DetailsView1" runat="server" CssClass="datagrid" Visible="false"
        AutoGenerateRows="False" DataKeyNames="id" DataSourceID="LinqDataSource1" 
        oniteminserted="DetailsView1_ItemInserted" 
        oniteminserting="DetailsView1_ItemInserting">
        <Fields>
            <asp:BoundField DataField="id" HeaderText="id" InsertVisible="False" 
                ReadOnly="True" SortExpression="id" Visible="False" />
            <asp:BoundField DataField="mode" HeaderText="mode" SortExpression="mode" >
                <HeaderStyle Width="150px" />
            </asp:BoundField>
            <asp:BoundField DataField="giatu" HeaderText="giatu" SortExpression="giatu" />
            <asp:BoundField DataField="giaden" HeaderText="giaden" 
                SortExpression="giaden" />
            <asp:CommandField ShowInsertButton="True" />
        </Fields>
    </asp:DetailsView>
    <asp:LinqDataSource ID="LinqDataSource1" runat="server" 
        ContextTypeName="KTSonline.KTSonlineDataContext" EnableDelete="True" 
        TableName="THAM_SO_GIAs" EnableInsert="True" EnableUpdate="True" 
        OrderBy="mode">
    </asp:LinqDataSource>
    </asp:Content>
